﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Xeralabs.Core.Events
{
    internal sealed class GDESKEvent : IEvent
    {
        private ulong _sender;
        private ulong _reciver;
        private double _time;
        private double _deltaTime;
        private byte _priority;
        private IMessage _message;

        public ulong Sender { get { return _sender; } }

        public ulong Reciver { get { return _reciver; } }

        public double DeltaTime { get { return _deltaTime; } }

        public double Time { get { return _time; } }

        public byte Priority { get { return _priority; } }

        public IMessage Message { get { return _message; } }

        internal GDESKEvent()
        {
            this.Release();
        }

        internal void Input(ulong sender, ulong target, double timeStamp, byte priority, IMessage message)
        {
            this._sender = sender;
            this._reciver = target;
            this._message = message;
            this._priority = priority;
            this._time = timeStamp;
        }

        internal void Release()
        {
            this._sender = 0;
            this._reciver = 0;
            this._message = default(IMessage);
            this._priority = 0;
            this._time = 0;
        }

        internal void SetTime(double sytemTime) { this._time += sytemTime; }
    }
}